package com.dove.service.impl;

import java.util.List;

import com.dove.common.MyProperties;
import com.dove.entity.Users;
import com.dove.entity.mapper.UsersMapper;
import com.dove.service.UsersService;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author dxw
 * 
 */
@Service
public class UsersServiceImpl implements UsersService {

	private final Logger logger = LoggerFactory.getLogger(this.getClass());

	@Autowired
	private MyProperties myProperties;

	@Autowired
	private UsersMapper usersMapper;

	@Override
	public int insert(Users users) {
		int i = usersMapper.insert(users);
		return i;
	}

	@Override
	public int delete(String userid) {
		int i = usersMapper.delete(userid);
		return i;
	}

	@Override
	public int update(Users users) {
		int i = usersMapper.update(users);
		return i;

	}

	@Override
	public List<Users> findByUserid(String userid) {
		logger.info("user - myProperties="+ myProperties.getDove());
		List<Users> userslist = usersMapper.findByUserid(userid);


		
		return userslist;
	}

}